import { getSheetDetail } from '@/services/commonService';
import { getSearchQuery } from '@/utils';
import React, { useEffect, useState } from 'react';

const PdfHtml = () => {
  const [htmlStr, setHtmlStr] = useState('');

  useEffect(() => {
    const id = getSearchQuery('id');
    getData(id);
    return () => {};
  }, []);

  const getData = async (id) => {
    const res = await getSheetDetail(id);
    console.log('res', res.data);
    if (res.data) {
      setHtmlStr(res.data);
    }
  };
  return <div dangerouslySetInnerHTML={{ __html: htmlStr }}></div>;
};

export default PdfHtml;
